<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>switch</title>
</head>
<body>
    <script>
        var a;
        switch (a) {
            case 1:
                alert('number');
                break
            case 'abc':
                alert('string');
                break
            case true:
                alert('boolean');
                break
            case null:
                alert('null');
                break
            case undefined:
                alert('undefined');
                break
            }
    </script>
</body>
</html>